package com.example.demo.server.service;

import com.example.demo.ds.MyList;
import com.example.demo.server.dao.ArticleDao;
import com.example.demo.server.model.ArticleInfo;


public class ArticleService {


    private ArticleDao articleDao = new ArticleDao();

    public int publish(ArticleInfo articleInfo) {
        return articleDao.insert(articleInfo);
    }

    public MyList<ArticleInfo> getMyArts(int uid) {
        return articleDao.getListByUid(uid);
    }

    public int delete(ArticleInfo articleInfo) {
        return articleDao.delete(articleInfo);
    }

    public int update(ArticleInfo articleInfo) {
        return articleDao.updateArticle(articleInfo);
    }
    public int getArtNumberByUid(int uid) {
        return articleDao.getArtNumberByUid(uid);
    }

    public int incrementRCount(int aid) {
        return articleDao.incrementRCount(aid);
    }
    public MyList<ArticleInfo> getSubList(int limit, int offset) {
        return articleDao.getSubList(limit, offset);
    }

    public int getNumber() {
        return articleDao.getNumber();
    }

}
